﻿using System.IO;
using Klinkby.PipesAndFilters;

namespace StrongTypedPipesAndFilters
{
    class FileFilter : IFilter<string, byte[]>
    {
        public byte[] Process(string value)
        {
            return File.ReadAllBytes(value);
        }

        public bool CanProcess(string value)
        {
            return value != null && File.Exists(value);
        }

        public void Dispose()
        { }
    }
}
